home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / hanna-in-a-choppa.swf / scripts / __Packages / com / mosesSupposes / fuse / ZigoEngine.as < prev    next >
Encoding:
Text File  |  2011-12-21  |  21.1 KB  |  549 lines

  1. class com.mosesSupposes.fuse.ZigoEngine
  2. {
  3.    var __zigoID__;
  4.    var oldAddListener;
  5.    static var _listeners;
  6.    static var broadcastMessage;
  7.    static var extensions;
  8.    static var updateTime;
  9.    static var tweenHolder;
  10.    static var instance;
  11.    static var updateIntId;
  12.    static var VERSION = com.mosesSupposes.fuse.FuseKitCommon.VERSION + ", ZigoEngine based on concepts by L.Zigo";
  13.    static var EASING = "easeOutQuint";
  14.    static var DURATION = 1;
  15.    static var TIME_MULTIPLIER = 1;
  16.    static var ROUND_RESULTS = false;
  17.    static var OUTPUT_LEVEL = 1;
  18.    static var AUTOSTOP = false;
  19.    static var SKIP_LEVEL = 0;
  20.    static var _playing = false;
  21.    static var zigoIDs = 0;
  22.    static var prevTimeMult = 1;
  23.    function ZigoEngine()
  24.    {
  25.    }
  26.    static function addListener(handler)
  27.    {
  28.       AsBroadcaster.initialize(com.mosesSupposes.fuse.ZigoEngine);
  29.       com.mosesSupposes.fuse.ZigoEngine.addListener(handler);
  30.    }
  31.    static function removeListener(handler)
  32.    {
  33.    }
  34.    static function isPlaying()
  35.    {
  36.       return com.mosesSupposes.fuse.ZigoEngine._playing;
  37.    }
  38.    static function simpleSetup(shortcutsClass)
  39.    {
  40.       if(arguments.length > 0)
  41.       {
  42.          com.mosesSupposes.fuse.ZigoEngine.register.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  43.       }
  44.       _global.ZigoEngine = com.mosesSupposes.fuse.ZigoEngine;
  45.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuse != undefined)
  46.       {
  47.          _global.Fuse = com.mosesSupposes.fuse.ZigoEngine.extensions.fuse;
  48.       }
  49.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseFMP != undefined)
  50.       {
  51.          com.mosesSupposes.fuse.ZigoEngine.extensions.fuseFMP.simpleSetup();
  52.       }
  53.       com.mosesSupposes.fuse.ZigoEngine.initialize(MovieClip.prototype,Button.prototype,TextField.prototype);
  54.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts == undefined)
  55.       {
  56.          com.mosesSupposes.fuse.FuseKitCommon.error("001");
  57.       }
  58.    }
  59.    static function register(classReference)
  60.    {
  61.       if(com.mosesSupposes.fuse.ZigoEngine.extensions == undefined)
  62.       {
  63.          com.mosesSupposes.fuse.ZigoEngine.extensions = {};
  64.       }
  65.       var _loc3_ = "|fuse|fuseItem|fuseFMP|shortcuts|pennerEasing|customEasing|";
  66.       for(var _loc4_ in arguments)
  67.       {
  68.          var _loc2_ = arguments[_loc4_].registryKey;
  69.          if(com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_] == undefined && _loc3_.indexOf("|" + _loc2_ + "|") > -1)
  70.          {
  71.             com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_] = arguments[_loc4_];
  72.             if(_loc2_ == "fuseFMP" || _loc2_ == "shortcuts")
  73.             {
  74.                Object(com.mosesSupposes.fuse.ZigoEngine.extensions[_loc2_]).initialize();
  75.             }
  76.          }
  77.       }
  78.    }
  79.    static function initialize(target)
  80.    {
  81.       if(arguments.length > 0)
  82.       {
  83.          com.mosesSupposes.fuse.ZigoEngine.initializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  84.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts != undefined)
  85.          {
  86.             com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.addShortcutsTo.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  87.          }
  88.       }
  89.    }
  90.    static function deinitialize(target)
  91.    {
  92.       if(arguments.length == 0 || target == null)
  93.       {
  94.          arguments.push(MovieClip.prototype,Button.prototype,TextField.prototype);
  95.       }
  96.       com.mosesSupposes.fuse.ZigoEngine.deinitializeTargets.apply(com.mosesSupposes.fuse.ZigoEngine,arguments);
  97.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts != undefined)
  98.       {
  99.          com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.removeShortcutsFrom.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  100.       }
  101.    }
  102.    static function getUpdateInterval()
  103.    {
  104.       return com.mosesSupposes.fuse.ZigoEngine.updateTime;
  105.    }
  106.    static function setUpdateInterval(time)
  107.    {
  108.       if(com.mosesSupposes.fuse.ZigoEngine._playing)
  109.       {
  110.          com.mosesSupposes.fuse.ZigoEngine.setup(true);
  111.          com.mosesSupposes.fuse.ZigoEngine.updateTime = time;
  112.          com.mosesSupposes.fuse.ZigoEngine.setup();
  113.       }
  114.       else
  115.       {
  116.          com.mosesSupposes.fuse.ZigoEngine.updateTime = time;
  117.       }
  118.    }
  119.    static function getControllerDepth()
  120.    {
  121.       return com.mosesSupposes.fuse.ZigoEngine.tweenHolder.getDepth();
  122.    }
  123.    static function setControllerDepth(depth)
  124.    {
  125.       if(depth == null || _global.isNaN(depth) == true)
  126.       {
  127.          depth = 6789;
  128.       }
  129.       if(Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof != null)
  130.       {
  131.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder.swapDepths(depth);
  132.       }
  133.       else
  134.       {
  135.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder = _root.createEmptyMovieClip("ZigoEnginePulse",depth);
  136.       }
  137.    }
  138.    static function doShortcut(targets, methodName)
  139.    {
  140.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts == undefined)
  141.       {
  142.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  143.          {
  144.             com.mosesSupposes.fuse.FuseKitCommon.error("002");
  145.          }
  146.          return null;
  147.       }
  148.       return com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts.doShortcut.apply(com.mosesSupposes.fuse.ZigoEngine.extensions.shortcuts,arguments);
  149.    }
  150.    static function doTween(targets, props, endvals, seconds, ease, delay, callback)
  151.    {
  152.       if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuse.addBuildItem(arguments) == true)
  153.       {
  154.          return null;
  155.       }
  156.       if(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER != com.mosesSupposes.fuse.ZigoEngine.prevTimeMult)
  157.       {
  158.          com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER = Math.abs(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER);
  159.          if(_global.isNaN(com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER) == true)
  160.          {
  161.             com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER = 1;
  162.          }
  163.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  164.          {
  165.             com.mosesSupposes.fuse.FuseKitCommon.error("016",com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER);
  166.          }
  167.          com.mosesSupposes.fuse.ZigoEngine.prevTimeMult = com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  168.       }
  169.       if(com.mosesSupposes.fuse.ZigoEngine.instance == undefined || Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof == undefined && com.mosesSupposes.fuse.ZigoEngine.updateTime == undefined)
  170.       {
  171.          if(MovieClip.prototype.tween != null && typeof _global.$tweenManager == "object")
  172.          {
  173.             com.mosesSupposes.fuse.FuseKitCommon.error("003");
  174.          }
  175.          com.mosesSupposes.fuse.ZigoEngine.instance = new com.mosesSupposes.fuse.ZManager();
  176.          com.mosesSupposes.fuse.ZigoEngine._playing = false;
  177.       }
  178.       var _loc4_ = com.mosesSupposes.fuse.ZigoEngine.instance.paramsObj(targets,props,endvals,true);
  179.       var _loc7_ = !(_loc4_.tg[0] == null || _loc4_.tg.length == 0) ? _loc4_.tg : undefined;
  180.       if(_loc4_.pa == undefined || _loc7_ == undefined || arguments.length < 3)
  181.       {
  182.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem != null && arguments.length == 1 && typeof arguments[0] == "object")
  183.          {
  184.             return com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem.doTween(arguments[0]);
  185.          }
  186.          if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  187.          {
  188.             if(arguments.length < 3)
  189.             {
  190.                com.mosesSupposes.fuse.FuseKitCommon.error("004",!(arguments.length == 1 && arguments[0] == null) ? String(arguments.length) : "1 (null)",Boolean(com.mosesSupposes.fuse.ZigoEngine.extensions.fuseItem == null));
  191.             }
  192.             else
  193.             {
  194.                com.mosesSupposes.fuse.FuseKitCommon.error("005",_loc7_.toString(),_loc4_.pa.toString());
  195.             }
  196.          }
  197.          return null;
  198.       }
  199.       if(com.mosesSupposes.fuse.ZigoEngine._playing != true)
  200.       {
  201.          com.mosesSupposes.fuse.ZigoEngine.setup();
  202.       }
  203.       if(seconds == null || _global.isNaN(seconds) == true)
  204.       {
  205.          seconds = com.mosesSupposes.fuse.ZigoEngine.DURATION || 1;
  206.       }
  207.       else if(seconds < 0.01)
  208.       {
  209.          seconds = 0;
  210.       }
  211.       seconds *= com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  212.       if(delay < 0.01 || delay == null || _global.isNaN(delay) == true)
  213.       {
  214.          delay = 0;
  215.       }
  216.       delay *= com.mosesSupposes.fuse.ZigoEngine.TIME_MULTIPLIER;
  217.       var _loc12_ = com.mosesSupposes.fuse.FuseKitCommon.parseCallback(callback,_loc7_,com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL,true);
  218.       var _loc9_ = undefined;
  219.       if(typeof ease == "function")
  220.       {
  221.          if(typeof Function(ease).call(null,1,1,1,1) == "number")
  222.          {
  223.             _loc9_ = Function(ease);
  224.          }
  225.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  226.          {
  227.             com.mosesSupposes.fuse.FuseKitCommon.error("014",ease);
  228.          }
  229.       }
  230.       else if(ease == null || ease == "")
  231.       {
  232.          if(com.mosesSupposes.fuse.ZigoEngine.EASING instanceof Function)
  233.          {
  234.             _loc9_ = Function(com.mosesSupposes.fuse.ZigoEngine.EASING);
  235.          }
  236.          else if(com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing != undefined)
  237.          {
  238.             ease = com.mosesSupposes.fuse.ZigoEngine.EASING;
  239.          }
  240.       }
  241.       if(typeof ease == "string" && ease != "")
  242.       {
  243.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing[ease] != undefined)
  244.          {
  245.             _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.pennerEasing[ease];
  246.          }
  247.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  248.          {
  249.             com.mosesSupposes.fuse.FuseKitCommon.error("006",ease);
  250.          }
  251.       }
  252.       else if(ease instanceof Array)
  253.       {
  254.          if(com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing != undefined)
  255.          {
  256.             _loc12_.extra1 = ease;
  257.             if(typeof ease[0] == "number")
  258.             {
  259.                _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing.precalced;
  260.             }
  261.             else
  262.             {
  263.                _loc9_ = com.mosesSupposes.fuse.ZigoEngine.extensions.customEasing.fromCurve;
  264.             }
  265.          }
  266.          else if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  267.          {
  268.             com.mosesSupposes.fuse.FuseKitCommon.error("015",ease);
  269.          }
  270.       }
  271.       if(typeof _loc9_ != "function")
  272.       {
  273.          _loc9_ = function(t, b, c, d)
  274.          {
  275.             return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
  276.          };
  277.       }
  278.       if(com.mosesSupposes.fuse.ZigoEngine._listeners.length > 0)
  279.       {
  280.          com.mosesSupposes.fuse.ZigoEngine.broadcastMessage.call(com.mosesSupposes.fuse.ZigoEngine,"onTweenAdd",_loc7_,_loc4_.pa,_loc4_.va,seconds,_loc9_,delay,_loc12_);
  281.       }
  282.       var _loc6_ = "";
  283.       for(var _loc13_ in _loc7_)
  284.       {
  285.          var _loc3_ = _loc7_[_loc13_];
  286.          if(_loc3_.__zigoID__ == null)
  287.          {
  288.             com.mosesSupposes.fuse.ZigoEngine.initializeTargets(_loc3_);
  289.          }
  290.          else if(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("locked",_loc3_) == true)
  291.          {
  292.             if(com.mosesSupposes.fuse.ZigoEngine.OUTPUT_LEVEL > 0)
  293.             {
  294.                com.mosesSupposes.fuse.FuseKitCommon.error("007",_loc3_._name == undefined ? _loc3_.toString() : _loc3_._name,_loc4_.pa.toString());
  295.             }
  296.             continue;
  297.          }
  298.          var _loc5_ = com.mosesSupposes.fuse.ZigoEngine.instance.addTween(_loc3_,_loc4_.pa,_loc4_.va,seconds,_loc9_,delay,_loc12_);
  299.          _loc6_ = (_loc5_ != null ? _loc5_ + "|" : "|") + _loc6_;
  300.       }
  301.       _loc6_ = _loc6_.slice(0,-1);
  302.       return !(_loc6_ == "" || _loc6_ == "|") ? _loc6_ : null;
  303.    }
  304.    static function removeTween(targs, props)
  305.    {
  306.       com.mosesSupposes.fuse.ZigoEngine.instance.removeTween(targs,props);
  307.    }
  308.    static function isTweening(targ, prop)
  309.    {
  310.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("active",targ,prop));
  311.    }
  312.    static function getTweens(targ)
  313.    {
  314.       if(com.mosesSupposes.fuse.ZigoEngine.instance == undefined)
  315.       {
  316.          return 0;
  317.       }
  318.       return Number(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("count",targ));
  319.    }
  320.    static function lockTween(targ, setLocked)
  321.    {
  322.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("lock",targ,setLocked == true);
  323.    }
  324.    static function isTweenLocked(targ)
  325.    {
  326.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("locked",targ));
  327.    }
  328.    static function ffTween(targs, props, suppressEndEvents)
  329.    {
  330.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("ff",targs,props,null,suppressEndEvents);
  331.    }
  332.    static function skipTweenTo(seconds, targs, props)
  333.    {
  334.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("skipTo",targs,props,false,false,seconds);
  335.    }
  336.    static function rewTween(targs, props, pauseFlag, suppressStartEvents)
  337.    {
  338.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("rewind",targs,props,pauseFlag,suppressStartEvents);
  339.    }
  340.    static function isTweenPaused(targ, prop)
  341.    {
  342.       return Boolean(com.mosesSupposes.fuse.ZigoEngine.instance.getStatus("paused",targ,prop));
  343.    }
  344.    static function pauseTween(targs, props)
  345.    {
  346.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("pause",targs,props);
  347.    }
  348.    static function unpauseTween(targs, props)
  349.    {
  350.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("unpause",targs,props);
  351.    }
  352.    static function resumeTween(targs, props)
  353.    {
  354.       com.mosesSupposes.fuse.ZigoEngine.instance.alterTweens("unpause",targs,props);
  355.    }
  356.    static function setColorByKey(targetObj, type, amt, rgb)
  357.    {
  358.       new Color(targetObj).setTransform(com.mosesSupposes.fuse.ZigoEngine.getColorTransObj(type,amt,rgb));
  359.    }
  360.    static function getColorTransObj(type, amt, rgb)
  361.    {
  362.       switch(type)
  363.       {
  364.          case "brightness":
  365.             var _loc3_ = 100 - Math.abs(amt);
  366.             var _loc4_ = amt <= 0 ? 0 : 255 * (amt / 100);
  367.             return {ra:_loc3_,rb:_loc4_,ga:_loc3_,gb:_loc4_,ba:_loc3_,bb:_loc4_};
  368.          case "brightOffset":
  369.             return {ra:100,rb:255 * (amt / 100),ga:100,gb:255 * (amt / 100),ba:100,bb:255 * (amt / 100)};
  370.          case "contrast":
  371.             return {ra:amt,rb:128 - 1.28 * amt,ga:amt,gb:128 - 1.28 * amt,ba:amt,bb:128 - 1.28 * amt};
  372.          case "invertColor":
  373.             return {ra:100 - 2 * amt,rb:amt * 2.55,ga:100 - 2 * amt,gb:amt * 2.55,ba:100 - 2 * amt,bb:amt * 2.55};
  374.          case "tint":
  375.             if(rgb != null)
  376.             {
  377.                var _loc5_ = undefined;
  378.                if(typeof rgb == "string")
  379.                {
  380.                   if(rgb.charAt(0) == "#")
  381.                   {
  382.                      rgb = rgb.slice(1);
  383.                   }
  384.                   rgb = rgb.charAt(1).toLowerCase() == "x" ? rgb : "0x" + rgb;
  385.                }
  386.                _loc5_ = Number(rgb);
  387.                return {ra:100 - amt,rb:(_loc5_ >> 16) * (amt / 100),ga:100 - amt,gb:(_loc5_ >> 8 & 255) * (amt / 100),ba:100 - amt,bb:(_loc5_ & 255) * (amt / 100)};
  388.             }
  389.             break;
  390.       }
  391.       return {rb:0,ra:100,gb:0,ga:100,bb:0,ba:100};
  392.    }
  393.    static function getColorKeysObj(targOrTransObj)
  394.    {
  395.       var _loc1_ = targOrTransObj.ra == undefined ? new Color(targOrTransObj).getTransform() : targOrTransObj;
  396.       var _loc6_ = _loc1_.ra == _loc1_.ga && _loc1_.ga == _loc1_.ba;
  397.       var _loc8_ = _loc1_.rb == _loc1_.gb && _loc1_.gb == _loc1_.bb;
  398.       var _loc3_ = {tintPercent:Number(_loc6_ != true ? 0 : 100 - _loc1_.ra)};
  399.       if(_loc3_.tintPercent != 0)
  400.       {
  401.          var _loc5_ = 100 / _loc3_.tintPercent;
  402.          _loc3_.tint = _loc1_.rb * _loc5_ << 16 | _loc1_.gb * _loc5_ << 8 | _loc1_.bb * _loc5_;
  403.          var _loc2_ = _loc3_.tint.toString(16);
  404.          var _loc4_ = 6 - _loc2_.length;
  405.          while(true)
  406.          {
  407.             _loc4_;
  408.             if(_loc4_-- <= 0)
  409.             {
  410.                break;
  411.             }
  412.             _loc2_ = "0" + _loc2_;
  413.          }
  414.          _loc3_.tintString = "0x" + _loc2_.toUpperCase();
  415.       }
  416.       if(_loc6_ == true && _loc8_ == true)
  417.       {
  418.          if(_loc1_.ra < 0)
  419.          {
  420.             _loc3_.invertColor = _loc1_.rb * 0.39215686274509803;
  421.          }
  422.          else if(_loc1_.ra == 100 && _loc1_.rb != 0)
  423.          {
  424.             _loc3_.brightOffset = _loc1_.rb * 0.39215686274509803;
  425.          }
  426.          if(_loc1_.ra != 100)
  427.          {
  428.             if(_loc1_.rb == 0 || _loc1_.rb != 0 && 255 * ((100 - _loc1_.ra) / 100) - _loc1_.rb <= 1)
  429.             {
  430.                _loc3_.brightness = _loc1_.rb == 0 ? _loc1_.ra - 100 : 100 - _loc1_.ra;
  431.             }
  432.             if(128 - 1.28 * _loc1_.ra - _loc1_.rb <= 1)
  433.             {
  434.                _loc3_.contrast = _loc1_.ra;
  435.             }
  436.          }
  437.       }
  438.       return _loc3_;
  439.    }
  440.    static function initializeTargets()
  441.    {
  442.       for(var _loc5_ in arguments)
  443.       {
  444.          var _loc4_ = arguments[_loc5_];
  445.          if(_loc4_ == MovieClip.prototype || _loc4_ == Button.prototype || _loc4_ == TextField.prototype || _loc4_ == Object.prototype)
  446.          {
  447.             if(_loc4_.oldAddListener == undefined)
  448.             {
  449.                if(_loc4_ == TextField.prototype)
  450.                {
  451.                   _loc4_.oldAddListener = _loc4_.addListener;
  452.                   _global.ASSetPropFlags(_loc4_,"oldAddListener",7,1);
  453.                }
  454.                _loc4_.addListener = function(o)
  455.                {
  456.                   if(this.__zigoID__ == undefined)
  457.                   {
  458.                      com.mosesSupposes.fuse.ZigoEngine.initializeTargets(this);
  459.                   }
  460.                   if(this instanceof TextField)
  461.                   {
  462.                      Function(this.oldAddListener).call(this,o);
  463.                   }
  464.                   else
  465.                   {
  466.                      this.addListener(o);
  467.                   }
  468.                };
  469.                if(_loc4_ == MovieClip.prototype)
  470.                {
  471.                   _global.ASSetPropFlags(_loc4_,"addListener",7,1);
  472.                }
  473.             }
  474.          }
  475.          else if(_loc4_.__zigoID__ == undefined)
  476.          {
  477.             _loc4_.__zigoID__ = com.mosesSupposes.fuse.ZigoEngine.zigoIDs;
  478.             _global.ASSetPropFlags(_loc4_,"__zigoID__",7,1);
  479.             com.mosesSupposes.fuse.ZigoEngine.zigoIDs = com.mosesSupposes.fuse.ZigoEngine.zigoIDs + 1;
  480.             if(_loc4_._listeners == null || _loc4_.addListener == null)
  481.             {
  482.                AsBroadcaster.initialize(_loc4_);
  483.             }
  484.          }
  485.       }
  486.    }
  487.    static function deinitializeTargets()
  488.    {
  489.       for(var _loc4_ in arguments)
  490.       {
  491.          var _loc3_ = arguments[_loc4_];
  492.          if(_loc3_.__zigoID__ != undefined)
  493.          {
  494.             _global.ASSetPropFlags(_loc3_,"__zigoID__,_listeners,broadcastMessage,addListener,removeListener",0,2);
  495.             delete _loc3_.__zigoID__;
  496.             delete _loc3_._listeners;
  497.             delete _loc3_.broadcastMessage;
  498.             delete _loc3_.addListener;
  499.             delete _loc3_.removeListener;
  500.          }
  501.          if(_loc3_.oldAddListener != undefined)
  502.          {
  503.             _global.ASSetPropFlags(_loc3_,"oldAddListener",0,2);
  504.             _loc3_.addListener = _loc3_.oldAddListener;
  505.             delete _loc3_.oldAddListener;
  506.          }
  507.       }
  508.    }
  509.    static function __mgrRelay(inst, method, args)
  510.    {
  511.       if(inst == com.mosesSupposes.fuse.ZigoEngine.instance)
  512.       {
  513.          Function(com.mosesSupposes.fuse.ZigoEngine[method]).apply(com.mosesSupposes.fuse.ZigoEngine,args);
  514.       }
  515.    }
  516.    static function setup(deinitFlag)
  517.    {
  518.       if(deinitFlag == true)
  519.       {
  520.          com.mosesSupposes.fuse.ZigoEngine._playing = false;
  521.          clearInterval(com.mosesSupposes.fuse.ZigoEngine.updateIntId);
  522.          delete com.mosesSupposes.fuse.ZigoEngine.tweenHolder.onEnterFrame;
  523.          return undefined;
  524.       }
  525.       com.mosesSupposes.fuse.ZigoEngine.instance.cleanUp();
  526.       clearInterval(com.mosesSupposes.fuse.ZigoEngine.updateIntId);
  527.       delete com.mosesSupposes.fuse.ZigoEngine.updateIntId;
  528.       if(com.mosesSupposes.fuse.ZigoEngine.updateTime != null && com.mosesSupposes.fuse.ZigoEngine.updateTime > 0)
  529.       {
  530.          com.mosesSupposes.fuse.ZigoEngine.updateIntId = setInterval(com.mosesSupposes.fuse.ZigoEngine.instance,"update",com.mosesSupposes.fuse.ZigoEngine.updateTime);
  531.       }
  532.       else
  533.       {
  534.          if(Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof == null)
  535.          {
  536.             com.mosesSupposes.fuse.ZigoEngine.setControllerDepth(6789);
  537.             Object(com.mosesSupposes.fuse.ZigoEngine.tweenHolder).proof = 1;
  538.          }
  539.          var _inst = com.mosesSupposes.fuse.ZigoEngine.instance;
  540.          com.mosesSupposes.fuse.ZigoEngine.tweenHolder.onEnterFrame = function()
  541.          {
  542.             _inst.update.call(_inst);
  543.          };
  544.       }
  545.       com.mosesSupposes.fuse.ZigoEngine._playing = true;
  546.       com.mosesSupposes.fuse.ZigoEngine.instance.now = getTimer();
  547.    }
  548. }
  549.